package com.ibm.risk.irmp.base.service.client;

import com.ibm.risk.irmp.base.dict.service.IDataDictBaseService;
import com.ibm.risk.irmp.base.dict.vo.BaseDictItemVo;
import com.ibm.risk.irmp.base.dict.vo.BaseDictVo;
import com.ibm.risk.irmp.common.vo.CodeLabelVo;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;

import java.util.List;
import java.util.Map;

@HttpExchange("/dict")
@Cacheable(cacheNames = "IrmpParamDataCache", key = "'IDataDictBaseService.' + methodName + args")
public interface DataDictBaseServiceClient extends IDataDictBaseService {
    @Override
    @GetExchange(value = "/items/default/{groupCode}")
    BaseDictItemVo getDefaultItemByGroup(@PathVariable String groupCode);

    @Override
    @GetExchange(value = "/dicts")
    List<? extends BaseDictVo> getDictList();

    @GetExchange(value = "/items/{groupCode}")
    @Override
    List<? extends BaseDictItemVo> getGroupItemList(@PathVariable String groupCode);

    @Override
    @GetExchange(value = "/item-code-labels/dicts/{groupCode}")
    List<CodeLabelVo> getItemCodeLabels(@PathVariable String groupCode, @RequestParam(required = false) String category);

    @Override
    @GetExchange(value = "/item-code-label-map/dicts/{groupCode}")
    Map<String, String> getItemCodeLabelMap(@PathVariable String groupCode, @RequestParam(required = false) String category);
}
